import sys
#sys.path.append('/data/xianjieyang/code/github/tts_ali/KAN-TTS')
from modelscope.outputs import OutputKeys
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

#p = pipeline('text-to-speech', './speech_sambert-hifigan_tts_zhisha_zh-cn_16k')
#p = pipeline('text-to-speech', './speech_sambert-hifigan_tts_zh-cn_16k')
p = pipeline('text-to-speech', model=sys.argv[1])
output=p('北京今天天气怎么样')
wav = output[OutputKeys.OUTPUT_WAV]
with open(sys.argv[2], 'wb') as f:
        f.write(wav)
